/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifal.alsuhaul.gui;

import javax.swing.JOptionPane;

/**
 *
 * @author ifa
 */
public class FrmFaturamentoMensal extends javax.swing.JFrame {

    /**
     * Creates new form FrmFaturamentoMensal
     */
    public FrmFaturamentoMensal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlFaturamentoMensal = new javax.swing.JPanel();
        lblCodigoProduto = new javax.swing.JLabel();
        lblDataSaida = new javax.swing.JLabel();
        lblQntdSaida = new javax.swing.JLabel();
        lblMarcaProduto = new javax.swing.JLabel();
        lblTipoProduto = new javax.swing.JLabel();
        lblLote = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblEstoqueAtual = new javax.swing.JLabel();
        lblFaturamento = new javax.swing.JLabel();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
        filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 13), new java.awt.Dimension(0, 13), new java.awt.Dimension(32767, 13));
        txtCodigoProduto = new javax.swing.JTextField();
        spnQntdSaida = new javax.swing.JSpinner();
        spnMarcaProduto = new javax.swing.JSpinner();
        spnTipoProduto = new javax.swing.JSpinner();
        spnLote = new javax.swing.JSpinner();
        spnEstoqueAtual = new javax.swing.JSpinner();
        txtFaturamentoMensal = new javax.swing.JTextField();
        lblMenssagem = new javax.swing.JLabel();
        cmbDia = new javax.swing.JComboBox();
        cmbMes = new javax.swing.JComboBox();
        cmbAno = new javax.swing.JComboBox();
        btnFinalizar = new javax.swing.JButton();
        mnbAcessoFaturamento = new javax.swing.JMenuBar();
        mnAcessoFaturamento = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(33, 62, 251));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlFaturamentoMensal.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(41, 0, 255)), "Faturamento Mensal"));
        pnlFaturamentoMensal.setForeground(new java.awt.Color(54, 91, 222));

        lblCodigoProduto.setText("Código do Produto");

        lblDataSaida.setText("Data de Saída");

        lblQntdSaida.setText("Quantidade  de Saída");

        lblMarcaProduto.setText("Marca do Produto");

        lblTipoProduto.setText("Tipo do Produto");

        lblLote.setText("Lote ");

        lblEstoqueAtual.setText("Estoque Atual");

        lblFaturamento.setText("Faturamento Mensal");

        txtCodigoProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCodigoProdutoActionPerformed(evt);
            }
        });

        spnQntdSaida.setModel(new javax.swing.SpinnerNumberModel(0, 0, 1000, 1));

        spnMarcaProduto.setModel(new javax.swing.SpinnerListModel(new String[] {"Samsung", "Lenovo", "Positivo", "CEE"}));

        spnTipoProduto.setModel(new javax.swing.SpinnerListModel(new String[] {"Computador", "Teclado", "Caixa de Som", "Fone deOuvido", "Estabilizador"}));

        spnLote.setModel(new javax.swing.SpinnerNumberModel(Long.valueOf(1L), Long.valueOf(0L), Long.valueOf(100000L), Long.valueOf(1L)));

        spnEstoqueAtual.setModel(new javax.swing.SpinnerNumberModel(0, 0, 10000, 1));

        cmbDia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dia", " ", " ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));

        cmbMes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mês", " ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        cmbAno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ano", " ", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", " " }));

        javax.swing.GroupLayout pnlFaturamentoMensalLayout = new javax.swing.GroupLayout(pnlFaturamentoMensal);
        pnlFaturamentoMensal.setLayout(pnlFaturamentoMensalLayout);
        pnlFaturamentoMensalLayout.setHorizontalGroup(
            pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblCodigoProduto))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addGap(251, 251, 251))
                    .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblDataSaida)
                            .addComponent(lblQntdSaida)
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addComponent(cmbDia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(cmbMes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(cmbAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addComponent(spnLote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(76, 76, 76)
                                .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblMarcaProduto)
                                    .addComponent(spnMarcaProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblTipoProduto)
                                    .addComponent(spnTipoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblLote))
                                .addGap(51, 51, 51)
                                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblFaturamento)
                                    .addComponent(spnEstoqueAtual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblEstoqueAtual)
                                    .addComponent(txtFaturamentoMensal))))
                        .addContainerGap(112, Short.MAX_VALUE))
                    .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                        .addComponent(spnQntdSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(lblMenssagem, javax.swing.GroupLayout.PREFERRED_SIZE, 436, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        pnlFaturamentoMensalLayout.setVerticalGroup(
            pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                .addGap(80, 80, 80)
                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCodigoProduto)
                    .addComponent(jLabel7)
                    .addComponent(lblEstoqueAtual)
                    .addComponent(lblMarcaProduto))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                            .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlFaturamentoMensalLayout.createSequentialGroup()
                            .addComponent(spnMarcaProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(2, 2, 2)))
                    .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                        .addComponent(spnEstoqueAtual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addComponent(lblDataSaida)
                                .addGap(17, 17, 17))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addComponent(lblFaturamento)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtFaturamentoMensal))
                            .addComponent(lblQntdSaida)
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(spnTipoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cmbDia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cmbMes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cmbAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addComponent(lblLote)))
                        .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pnlFaturamentoMensalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(spnQntdSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(spnLote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(pnlFaturamentoMensalLayout.createSequentialGroup()
                                .addGap(39, 39, 39)
                                .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblMenssagem, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE))
                    .addComponent(lblTipoProduto))
                .addContainerGap())
        );

        getContentPane().add(pnlFaturamentoMensal, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, -1, -1));

        btnFinalizar.setText("Finalizar");
        btnFinalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFinalizarActionPerformed(evt);
            }
        });
        getContentPane().add(btnFinalizar, new org.netbeans.lib.awtextra.AbsoluteConstraints(225, 435, 297, -1));

        mnAcessoFaturamento.setText("Acesso ao Faturamento");
        mnbAcessoFaturamento.add(mnAcessoFaturamento);

        setJMenuBar(mnbAcessoFaturamento);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtCodigoProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCodigoProdutoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCodigoProdutoActionPerformed

    private void btnFinalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinalizarActionPerformed
        String cp = txtCodigoProduto.getText();
        String fm = txtFaturamentoMensal.getText();
        if (cp.equals("") || fm.equals("") ) {
            lblMenssagem.setText("Houve um erro ao finalizar o faturamento mensal!");

        }
        else{
        JOptionPane.showMessageDialog(null, "O faturamento nesse mês foi de : R$" + fm);
        }
    }//GEN-LAST:event_btnFinalizarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmFaturamentoMensal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmFaturamentoMensal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmFaturamentoMensal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmFaturamentoMensal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmFaturamentoMensal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnFinalizar;
    private javax.swing.JComboBox cmbAno;
    private javax.swing.JComboBox cmbDia;
    private javax.swing.JComboBox cmbMes;
    private javax.swing.Box.Filler filler1;
    private javax.swing.Box.Filler filler2;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel lblCodigoProduto;
    private javax.swing.JLabel lblDataSaida;
    private javax.swing.JLabel lblEstoqueAtual;
    private javax.swing.JLabel lblFaturamento;
    private javax.swing.JLabel lblLote;
    private javax.swing.JLabel lblMarcaProduto;
    private javax.swing.JLabel lblMenssagem;
    private javax.swing.JLabel lblQntdSaida;
    private javax.swing.JLabel lblTipoProduto;
    private javax.swing.JMenu mnAcessoFaturamento;
    private javax.swing.JMenuBar mnbAcessoFaturamento;
    private javax.swing.JPanel pnlFaturamentoMensal;
    private javax.swing.JSpinner spnEstoqueAtual;
    private javax.swing.JSpinner spnLote;
    private javax.swing.JSpinner spnMarcaProduto;
    private javax.swing.JSpinner spnQntdSaida;
    private javax.swing.JSpinner spnTipoProduto;
    private javax.swing.JTextField txtCodigoProduto;
    private javax.swing.JTextField txtFaturamentoMensal;
    // End of variables declaration//GEN-END:variables
}
